<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<p class="my-data"></p>
<script  src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
    axios({
        url:'http://hmajax.itheima.net/api/city',
        //传递查询参数
        params:{
            pname:'上海'
        }
    }).then(result=>{
        console.log(result.data.list)
        document.querySelector('.my-data').innerHTML=result.data.list.join('<br>')
    })
</script> 
<body>
  
</body>
</html>